#pragma once

#include <wchar.h>

#define BOOL  int
#define TRUE  1
#define FALSE 0

typedef wchar_t       *str_w;
typedef const wchar_t *str_wc;

typedef unsigned char      byte;

// Calculate p2 - p1
#define PTR_D(p1, p2) ((byte *)(p2) - (byte *)(p1))

typedef char               i1;
typedef short              i2;
typedef int                i4;
typedef long long          i8;

typedef unsigned char      u1;
typedef unsigned short     u2;
typedef unsigned int       u4;
typedef unsigned long long u8;

typedef float              r4;
typedef double             r8;

#define CHECK_INT_SIZE() \
	(sizeof(byte) == 1   \
	&& sizeof(i1) == 1   \
	&& sizeof(i2) == 2   \
	&& sizeof(i4) == 4   \
	&& sizeof(i8) == 8   \
	&& sizeof(u1) == 1   \
	&& sizeof(u2) == 2   \
	&& sizeof(u4) == 4   \
	&& sizeof(u8) == 8   \
	&& sizeof(r4) == 4   \
	&& sizeof(r8) == 8)

typedef struct tag_guid
{
	u4 part1;
	u2 part2;
	u2 part3;
	u1 part4[8];
} guid;
